<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .hidDiv{
            background-color: rgba(255,0,0,0.5);
            left: 0;
            top: 0;
            position: absolute;
            visibility: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
        }

        .contentDiv{
            width: 550px;
            height: 350px;
            background-color: white;
            border: 1px solid black;
            padding: 50px;
        }
    </style>

    <script src="employee.js"></script>
    <script src="emService.js"></script>

</head>
<body>
<table border="1" width="80%">
    <thead>
    <tr><th>编号</th><th>姓名</th><th>工资</th><th>性别</th><th>操作</th></tr>
    </thead>

    <tbody id="data"></tbody>

</table>
    姓名：<input type="text" id="nameTxt">
        <input type="button" value="查找" onclick="findByName()"><br>
        <input type="button" value="添加" onclick="showAddDiv()"><br>
        <input type="button" value="按编号排序" onclick="sort()">

        <div class="hidDiv" id="addDiv">
        <div class="contentDiv">
            编号：<input type="text" id="codeTxt" ><span id="addCodeSpan"></span><br>
            姓名：<input type="text" id="emNameTxt"><span id="addNameSpan"></span><br>
            工资：<input type="text" id="moneyTxt"><span id="addMoneySpan"></span><br>
            性别：<input type="text" id="sexTxt"><span id="addSexSpan"></span><br>
            <input type="button" value="添加" onclick="add()">
            <input type="button" value="取消添加" onclick="addCancel()">
        </div>
        </div>

<div class="hidDiv" id="updateDiv">
    <div class="contentDiv">
        编号：<span id="codeSpan"></span><br>
        姓名：<span id="nameSpan"></span><br>
        工资：<input type="text" id="updateMoneyTxt"><span id="updateSpan"></span><br>
        性别：<span id="sexSpan"></span><br>
        <input type="button" value="修改" onclick="update()">
    </div>
</div>
</body>
</html>